#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	for (int i = 100; i <= 999; i++)
	{
		int c = i;
		int count = 0;
		while (c)
		{
			count += pow(c % 10, 3);
			c /= 10;
		}
		if (count == i)
			cout << i << endl;
	}
	return 0;
}
